using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
using Rest;

namespace Rest
{
    /// <summary>
    /// Event arguments from events relating to responses returned from
    /// RestCommand execution
    /// </summary>
    public class RestCommandEventArgs : EventArgs
    {
        private HttpWebResponse response;
        private Boolean cancel = false;

        /// <summary>
        /// Set to true to cancel event
        /// </summary>
        public Boolean Cancel
        {
            get { return cancel; }
            set { cancel = value; }
        } 

        /// <summary>
        /// The HttpResponse returned from command execution
        /// </summary>
        public HttpWebResponse Response
        {
            get { return response; }
            set { response = value; }
        }

        /// <summary>
        /// ctor
        /// </summary>
        public RestCommandEventArgs()
        { }

        /// <summary>
        /// ctor : HttpWebResponse
        /// </summary>
        /// <param name="response"></param>
        public RestCommandEventArgs(HttpWebResponse response) : this()
        {
            this.response = response;  
        }
    }
}
